﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Internal.Master" Inherits="BPM.Web.ViewPage" %>

<asp:Content ID="c1" ContentPlaceHolderID="TitleContent" runat="server">
	所有产品组装定义
</asp:Content>
<asp:Content ID="c2" ContentPlaceHolderID="ScriptStyleContent" runat="server">
</asp:Content>
<asp:Content ID="c3" ContentPlaceHolderID="MainContent" runat="server">
	<%
		var list = this.ViewData["List"] as IList<ProductAssembleDefinition>;
		if (list.Count == 0)
		{
	%>
	<div>
		暂时没有数据
	</div>
	<%
}
		else
		{
	%>
	<table class="altTable">
		<thead>
			<tr>
				<td>
					条码
				</td>
				<td>
					名称
				</td>
				<td>
					需要物料数
				</td>
				<td>
					创建时间
				</td>
				<td>
					创建者
				</td>
				<td>
				</td>
				<td>
				</td>
			</tr>
		</thead>
		<tbody>
			<%
var ad = AD.Singleton.Assemble;
foreach (var item in list)
{
	var materialCount = item.ItemList.Sum(i => i.Amount);
			%>
			<tr>
				<td>
					<%= item.Barcode.Number %>
				</td>
				<td>
					<%= item.Name %>
				</td>
				<td>
					<%= materialCount%>
				</td>
				<td>
					<%= item.CreatedTime %>
				</td>
				<td>
					<%= item.User.RealName %>
				</td>
				<td>
					<%= Html.ActionLink("查看物料列表", ad.ProductDefinitionAssemble, new { id = item.Id })%>
				</td>
				<td>
					<%= Html.ActionLink("进行组装页面", ad.ProductAssemble, new { productId = item.Id })%>
				</td>
			</tr>
			<%
}
			%>
		</tbody>
	</table>
	<%
}
	%>
</asp:Content>
